-- @Author: 作者QQ201878826
-- @Date:   2021-10-29 10:27:16
-- @Last Modified by:   作者QQ381990860
-- @Last Modified time: 2022-07-23 06:58:51
-- @Author: 作者QQ201878826
-- @Date:   2021-10-29 10:27:16
-- @Last Modified by:   作者QQ201878826
-- @Last Modified time: 2021-11-02 20:46:51

local 场景类_矿区系统 = class(窗口逻辑)
function 场景类_矿区系统:初始化(根)
    self.ID = 352
    self.x = 50
    self.y = 80
    self.xx = 0
    self.yy = 0
    self.注释 = "矿区仓库"
    self.可视 = false
    self.鼠标 = false
    self.焦点 = false
    self.可移动 = true
    self.窗口 = "矿区仓库"
    local 资源 = 根.资源
    local 按钮 = 根._按钮
    local 自适应 = 根._自适应
    self.资源组 = {
        [1] = 自适应.创建(0,1,710,400,3,9),
        --[1]= 资源:载入('乐天科技.dll',"网易WDF动画",0x00000025),
        [2]= 资源:载入('llm.dll',"网易WDF动画",0x08899106),

        [8]= 资源:载入('llm.dll',"网易WDF动画",0x08899105),
        [9]= 资源:载入('llm.dll',"网易WDF动画",0x08899103),
        [10]= 资源:载入('llm.dll',"网易WDF动画",0x08899102),
        [11]= 资源:载入('llm.dll',"网易WDF动画",0x08899101),
        [3] = 按钮.创建(自适应.创建(18,4,16,16,4,3),0,0,4,true,true),
        [4] = 根._按钮(根._自适应(13,4,72,20,1),0,0,4,true,true,"升级矿石"),
        [5] = 根._按钮(根._自适应(13,4,72,20,1),0,0,4,true,true,"提炼颜色"),
        [6] = 根._按钮(根._自适应(13,4,72,20,1),0,0,4,true,true,"熔炼属性"),
        --[7] = 按钮.创建(资源:载入('llm.dll',"网易WDF动画",0x02885884),0,0,4,true,true),


        [12]= 资源:载入('llm.dll',"网易WDF动画",0x00002019),
        [13]= 资源:载入('llm.dll',"网易WDF动画",0x00002021),
        [14]= 资源:载入('llm.dll',"网易WDF动画",0x00002023),
        [15]= 资源:载入('llm.dll',"网易WDF动画",0x00002025),
        [16]= 资源:载入('llm.dll',"网易WDF动画",0x00002027),
        [17]= 资源:载入('llm.dll',"网易WDF动画",0x00002029),
        [18]= 资源:载入('llm.dll',"网易WDF动画",0x00003106),
        [19]= 资源:载入('llm.dll',"网易WDF动画",0x00003108),
        [20]= 资源:载入('llm.dll',"网易WDF动画",0x00003104),
                  }
        for i=3,6 do
           self.资源组[i]:绑定窗口_(352)
        end

    local 格子 = 根._物品格子
    self.矿区 = {}
    for i=35,74 do
        self.矿区[i] = 格子(0,0,i,"矿区")
    end
    tp = 根
     self.窗口时间 = 0
end

function 场景类_矿区系统:刷新(数据)
   self.数据=数据
   self.更新=self.数据.类型
            for i=35,74 do
            self.矿区[i]:置物品(nil)
            end
            for i=35,74 do
            if self.数据[i] ~= nil and self.数据[i] ~= 0 then
            self.矿区[i]:置物品(self.数据[i])
            end
            end
end

function 场景类_矿区系统:打开(数据)
    if self.可视 then
        self.可视 = false
        self.窗口 = nil
        self.鼠标 = false

        for i=35,74 do
            self.矿区[i]:置物品(nil)
            self.矿区[i].确定=false
        end
        tp.抓取物品 = nil
        tp.抓取物品ID = nil
        self.更新 = nil
    else
       self.数据=数据
       self.更新  =self.数据.类型
        for i=35,74 do
            if self.数据[i] ~= nil and self.数据[i] ~= 0 then
               self.矿区[i]:置物品(self.数据[i])
            end
        end
        table.insert(tp.窗口_,self)
        tp.运行时间 = tp.运行时间 + 1
        self.窗口时间 = tp.运行时间
        self.可视 = true
    end
end


function 场景类_矿区系统:显示(dt,x,y)
    self.焦点 = false
    self.资源组[1]:显示(self.x,self.y)
    self.资源组[2]:显示(self.x+20,self.y+30)
    self.资源组[2]:显示(self.x+80,self.y+30)
    self.资源组[2]:显示(self.x+140,self.y+30)
    self.资源组[2]:显示(self.x+200,self.y+30)
    self.资源组[2]:显示(self.x+260,self.y+30)
    self.资源组[2]:显示(self.x+320,self.y+30)
    self.资源组[2]:显示(self.x+380,self.y+30)
    self.资源组[2]:显示(self.x+440,self.y+30)
   self.资源组[8]:显示(self.x+20,self.y+100)
   self.资源组[8]:显示(self.x+80,self.y+100)
    self.资源组[8]:显示(self.x+140,self.y+100)
    self.资源组[8]:显示(self.x+200,self.y+100)
    self.资源组[8]:显示(self.x+260,self.y+100)
    self.资源组[8]:显示(self.x+320,self.y+100)
    self.资源组[8]:显示(self.x+380,self.y+100)
    self.资源组[8]:显示(self.x+440,self.y+100)
    self.资源组[9]:显示(self.x+20,self.y+170)
   self.资源组[9]:显示(self.x+80,self.y+170)
    self.资源组[9]:显示(self.x+140,self.y+170)
    self.资源组[9]:显示(self.x+200,self.y+170)
    self.资源组[9]:显示(self.x+260,self.y+170)
    self.资源组[9]:显示(self.x+320,self.y+170)
    self.资源组[9]:显示(self.x+380,self.y+170)
    self.资源组[9]:显示(self.x+440,self.y+170)
    self.资源组[10]:显示(self.x+20,self.y+240)
   self.资源组[10]:显示(self.x+80,self.y+240)
    self.资源组[10]:显示(self.x+140,self.y+240)
    self.资源组[10]:显示(self.x+200,self.y+240)
    self.资源组[10]:显示(self.x+260,self.y+240)
    self.资源组[10]:显示(self.x+320,self.y+240)
    self.资源组[10]:显示(self.x+380,self.y+240)
    self.资源组[10]:显示(self.x+440,self.y+240)
    self.资源组[11]:显示(self.x+20,self.y+310)
   self.资源组[11]:显示(self.x+80,self.y+310)
    self.资源组[11]:显示(self.x+140,self.y+310)
    self.资源组[11]:显示(self.x+200,self.y+310)
    self.资源组[11]:显示(self.x+260,self.y+310)
    self.资源组[11]:显示(self.x+320,self.y+310)
    self.资源组[11]:显示(self.x+380,self.y+310)
    self.资源组[11]:显示(self.x+440,self.y+310)

    self.资源组[3]:显示(self.x+690,self.y+3)
    self.资源组[4]:显示(self.x+20,self.y+375)
    --self.资源组[5]:显示(self.x+140,self.y+375)
    self.资源组[6]:显示(self.x+140,self.y+375)
    --self.资源组[7]:显示(self.x+150,self.y+150)
    self.资源组[12]:显示(self.x+520,self.y+200)
    self.资源组[13]:显示(self.x+580,self.y+200)
    self.资源组[14]:显示(self.x+520,self.y+260)
    self.资源组[15]:显示(self.x+580,self.y+260)
    self.资源组[16]:显示(self.x+520,self.y+310)
    self.资源组[17]:显示(self.x+580,self.y+310)
    self.资源组[18]:显示(self.x+640,self.y+200)
    self.资源组[19]:显示(self.x+640,self.y+260)
    self.资源组[20]:显示(self.x+640,self.y+310)
    if self.资源组[12]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"2条属性")
    elseif self.资源组[13]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"3条属性")
    elseif self.资源组[14]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"4条属性")
    elseif self.资源组[15]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"5条属性")
    elseif self.资源组[16]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"7条属性")
    elseif self.资源组[17]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"6条属性")
    elseif self.资源组[18]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"升级石")
    elseif self.资源组[19]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"洗练石")
    elseif self.资源组[20]:是否选中(x,y) then
        tp.提示:自定义(x+80,y+30,"未激活")
    end

    tp.窗口标题背景_:显示(self.x+self.资源组[1].宽度/2-73,self.y)
    tp.字体表.描边字体:显示(self.x+320,self.y+1,"矿区仓库")
     for i=35,74 do
            if i == 35 then
            self.矿区[i]:置坐标(self.x+20+6,self.y+30+3)
            elseif i == 36 then
            self.矿区[i]:置坐标(self.x+80+6,self.y+30+3)
            elseif i == 37 then
            self.矿区[i]:置坐标(self.x+140+6,self.y+30+3)
            elseif i == 38 then
            self.矿区[i]:置坐标(self.x+200+6,self.y+30+3)
            elseif i == 39 then
            self.矿区[i]:置坐标(self.x+260+6,self.y+30+3)
            elseif i == 40 then
            self.矿区[i]:置坐标(self.x+320+6,self.y+30+3)
            elseif i == 41 then
            self.矿区[i]:置坐标(self.x+380+6,self.y+30+3)
            elseif i == 42 then
            self.矿区[i]:置坐标(self.x+440+6,self.y+30+3)
            elseif i == 43 then
            self.矿区[i]:置坐标(self.x+20+6,self.y+100+3)
            elseif i == 44 then
            self.矿区[i]:置坐标(self.x+80+6,self.y+100+3)
            elseif i == 45 then
            self.矿区[i]:置坐标(self.x+140+6,self.y+100+3)
            elseif i == 46 then
            self.矿区[i]:置坐标(self.x+200+6,self.y+100+3)
            elseif i == 47 then
            self.矿区[i]:置坐标(self.x+260+6,self.y+100+3)
            elseif i == 48 then
            self.矿区[i]:置坐标(self.x+320+6,self.y+100+3)
            elseif i == 49 then
            self.矿区[i]:置坐标(self.x+380+6,self.y+100+3)
            elseif i == 50 then
            self.矿区[i]:置坐标(self.x+440+6,self.y+100+3)
            elseif i == 51 then
            self.矿区[i]:置坐标(self.x+20+6,self.y+170+3)
            elseif i == 52 then
            self.矿区[i]:置坐标(self.x+80+6,self.y+170+3)
            elseif i == 53 then
            self.矿区[i]:置坐标(self.x+140+6,self.y+170+3)
            elseif i == 54 then
            self.矿区[i]:置坐标(self.x+200+6,self.y+170+3)
            elseif i == 55 then
            self.矿区[i]:置坐标(self.x+260+6,self.y+170+3)
            elseif i == 56 then
            self.矿区[i]:置坐标(self.x+320+6,self.y+170+3)
            elseif i == 57 then
            self.矿区[i]:置坐标(self.x+380+6,self.y+170+3)
            elseif i == 58 then
            self.矿区[i]:置坐标(self.x+440+6,self.y+170+3)
            elseif i == 59 then
            self.矿区[i]:置坐标(self.x+20+6,self.y+240+3)
            elseif i == 60 then
            self.矿区[i]:置坐标(self.x+80+6,self.y+240+3)
            elseif i == 61 then
            self.矿区[i]:置坐标(self.x+140+6,self.y+240+3)
            elseif i == 62 then
            self.矿区[i]:置坐标(self.x+200+6,self.y+240+3)
            elseif i == 63 then
            self.矿区[i]:置坐标(self.x+260+6,self.y+240+3)
            elseif i == 64 then
            self.矿区[i]:置坐标(self.x+320+6,self.y+240+3)
            elseif i == 65 then
            self.矿区[i]:置坐标(self.x+380+6,self.y+240+3)
            elseif i == 66 then
            self.矿区[i]:置坐标(self.x+440+6,self.y+240+3)
            elseif i == 67 then
            self.矿区[i]:置坐标(self.x+20+6,self.y+310+3)
            elseif i == 68 then
            self.矿区[i]:置坐标(self.x+80+6,self.y+310+3)
            elseif i == 69 then
            self.矿区[i]:置坐标(self.x+140+6,self.y+310+3)
            elseif i == 70 then
            self.矿区[i]:置坐标(self.x+200+6,self.y+310+3)
            elseif i == 71 then
            self.矿区[i]:置坐标(self.x+260+6,self.y+310+3)
            elseif i == 72 then
            self.矿区[i]:置坐标(self.x+320+6,self.y+310+3)
            elseif i == 73 then
            self.矿区[i]:置坐标(self.x+380+6,self.y+310+3)
            elseif i == 74 then
            self.矿区[i]:置坐标(self.x+440+6,self.y+310+3)

            end
            self.矿区[i]:显示(dt,x,y,self.鼠标,nil,0.7)
            if self.矿区[i].物品 ~= nil and self.矿区[i].焦点 then
                tp.提示:道具行囊(x,y,self.矿区[i].物品,true)
            end

            --if self.矿区[i].事件 and self.更新 =="矿区" then
            if self.矿区[i].事件 then
                    if self.矿区[i].焦点 and tp.抓取物品 == nil and self.矿区[i].物品 ~= nil then
                        tp.抓取物品ID = i
                           for q=35,74 do
                            self.矿区[q].确定=false
                           end
                        self.矿区[tp.抓取物品ID].确定 = true
                    end
            elseif self.矿区[i].右键 then
                客户端:发送数据(i,98,13,"包裹")
            end
        end

    self.资源组[3]:更新(x,y)
    self.资源组[4]:更新(x,y)
    self.资源组[5]:更新(x,y)
    self.资源组[6]:更新(x,y)
   -- self.资源组[7]:更新(x,y,self.数据[75]~=0)
     self.资源组[12]:更新(x,y)
      self.资源组[13]:更新(x,y)
       self.资源组[14]:更新(x,y)
        self.资源组[15]:更新(x,y)
         self.资源组[16]:更新(x,y)
         self.资源组[17]:更新(x,y)
         self.资源组[18]:更新(x,y)
         self.资源组[19]:更新(x,y)
    if self.资源组[3]:事件判断()  then
       self:打开()
    elseif self.资源组[4]:事件判断()  then
      if tp.抓取物品ID == nil then
        tp.提示:写入("#Y/点击矿石")
      else
        客户端:发送数据(tp.抓取物品ID,99,13)
      end
    elseif self.资源组[5]:事件判断()  then
      if tp.抓取物品ID == nil then
        tp.提示:写入("#Y/点击矿石")
      else
        客户端:发送数据(tp.抓取物品ID,101,13)
      end
    elseif self.资源组[6]:事件判断()  then
      if tp.抓取物品ID == nil then
        tp.提示:写入("#Y/点击矿石")
      else
        客户端:发送数据(tp.抓取物品ID,102,13)
      end
   -- elseif self.资源组[7]:是否选中(x,y) then

    end
end

return 场景类_矿区系统